// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App.vue'
import {Loading, MessageBox, Message, Notification} from 'element-ui';
import router from './router'
import 'element-ui/lib/theme-default/index.css'
import styles from "../static/freestyle.css"
import moment from 'moment'
import store from './store/index'
import * as hhUtil from './utils/HHUtil';

//导入edit
import VueQuillEditor from 'vue-quill-editor'

Vue.config.productionTip = false;
Vue.use(VueQuillEditor);

/**
 * element ui global
 */
Vue.use(Message.name, Message);
Vue.use(Notification.name, Notification);
Vue.use(Loading.directive);
Vue.use(MessageBox.name, MessageBox);

Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;
Vue.prototype.$moment = moment;
Vue.prototype.$hhUtil = hhUtil;


new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: {App, VueQuillEditor},
  
});

router.beforeEach((to, from, next) => {
  console.log(" ⛅ 进入", to);
  next();
});


Array.prototype.indexOf = function (val) {
  for (var i = 0; i < this.length; i++) {
    if (this[i] === val) return i;
  }
  return -1;
};

Array.prototype.remove = function (val) {
  var index = this.indexOf(val);
  if (index > -1) {
    this.splice(index, 1);
  }
  console.log(this);
};


